package com.laosg.study.base.ch4

/**
  * Created by kaimin on 9/5/2019.
  * time : 09:30
  */
object ScalaApply {
  def main(args: Array[String]): Unit = {

    var  p = Per.apply("xxx")
    println(p.name)
    var x = Per("111")
    println(x.name)
  }

}

class Per(inName:String){
  var name:String=inName
}
object Per{

  def apply(name:String): Per = new Per(name)

  def apply(): Per = new Per("匿名")


}
